from django.db import models
from django.contrib import admin

class disciplini(models.Model):
	nazvanie = models.CharField(max_length=50)
	kyrs_semmestr = models.CharField(max_length=9)
	kol_vo_lekcii = models.IntegerField(max_length=3, blank=True, null=True)
	prakticheskie_r= models.IntegerField(max_length=2, blank=True, null=True)
	laboratornie_r = models.IntegerField(max_length=2, blank=True, null=True)
	kol_vo_kyrsovikov = models.IntegerField(max_length=1, blank=True, null=True)
	kol_vo_domahnih_r = models.IntegerField(max_length=1, blank=True, null=True)
	kol_vo_referatov = models.IntegerField(max_length=1, blank=True, null=True)
	def __unicode__(self):
		return '%s' % (self.nazvanie)

class prepodavateli(models.Model):
	lastn = models.CharField(max_length=15)
	firstn = models.CharField(max_length=15)
	eshen = models.CharField(max_length=15)
	dolgnost = models.CharField(max_length=15)
	uchenoe_zvanie = models.CharField(max_length=15)
	stepen = models.CharField(max_length=15)
	def __unicode__(self):
		return '%s %s' % (self.lastn, self.firstn)
		
class gruppi_studentov(models.Model):
	shifr = models.IntegerField(max_length=6)
	filial = models.CharField(max_length=15)
	god_postupleniya = models.IntegerField(max_length=4)
	forma_obucheniya = models.CharField(max_length=15)
	kol_vo_studentov = models.IntegerField(max_length=3)
	def __unicode__(self):
		return '%s %s' % (self.shifr, self.god_postupleniya)

class koeficenty(models.Model):
	name = models.CharField(max_length=25)
	znacenie = models.CharField(max_length=4)

class work(models.Model):
	disciplina = models.ForeignKey(disciplini)
	prepodavatel = models.ForeignKey(prepodavateli)
	nomer_plana = models.CharField(max_length=15)
	ychebnii_god = models.CharField(max_length=15)
	opisanie = models.CharField(max_length=15)
	revision = models.CharField(max_length=50)
	def __unicode__(self):
		return '%s %s' % (self.ychebnii_god, self.disciplina)